#define _CRT_SECURE_NO_WARNINGS
#include "12.10_hs.h"

void Print_zf(char* p, int sz)
{
	char* s = p;
	while (s < p + sz)
	{
		printf("%c ", *(s));
		s++;
	}
	printf("%c", 10);
}

int My_strlen(char* p)
{
	char* s = p;
	while (*(p))
	{
		p++;
	}
	return p - s;
}

void test1()
{
	const int n = 5;
	int const m = 6;
	/*n = 1;//no
	m = 7;*/
	const int* pn = &n;
	const int* pm = &m;
	/**pn = 7;no
	*pm = 1;*/
	pn = &m;
	pm = &n;
	printf("%d %d\n", *pn, *pm);
}

void test2()
{
	int n = 10;
	int m = 20;
	int* const pn = &n;
	int* const pm = &m;
	*pn = 7;//ok
	*pm = 1;
	printf("%d %d", *pn, *pm);
	/*pn = &m;no
	pm = &n;*/
}

void test3()
{
	int n = 10;
	int m = 20;
	const int* const pn = &n;
	const int* const pm = &m;
	/**pn = 7;//no
	*pm = 1;
	pn = &m;
	pm = &n;*/
}

void Print_zf_sz(char(*pc)[3], int row, int col)
{
	for (int r = 0; r < row; r++)
	{
		for (int c = 0; c < col; c++)
		{
			printf("%c ", *(*(pc + r) + c));
		}
		printf("\n");
	}
}